package com.grasp.activity.scene;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.GridView;
import android.widget.Toast;

import com.grasp.activity.R;
import com.grasp.base.ActionBar;
import com.grasp.base.ActionBarOnClick;
import com.grasp.base.BaseActivity;
import com.grasp.base.CustomGridViewAdapter;
import com.grasp.base.CustomItemData;
import com.grasp.data.IconItem;

/**
 * 添加场景
 * 
 */
public class AddSceneActivity extends BaseActivity {

	private List<IconItem> mAreaItems;
	private CustomGridViewAdapter mAreaAdapter;
	private GridView mAreaGridView;
	private CheckBox mCheckBox;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.scene_add_layout);
		initActionBar();
		mAreaGridView = (GridView) findViewById(R.id.scene_select_area_gridview);
		mCheckBox = (CheckBox) findViewById(R.id.scene_select_all_checkbox);
		mAreaItems = new ArrayList<IconItem>();
		IconItem item = new IconItem();
		item.setTitle("添加场景");
		item.setFileName("icon_add");
		mAreaItems.add(item);
		mAreaAdapter = new CustomGridViewAdapter(this, mAreaItems);
		mAreaGridView.setAdapter(mAreaAdapter);
	}

	private void initActionBar() {
		ActionBar mActionBar = (ActionBar) findViewById(R.id.scene_add_scene_actionbar);
		mActionBar.setLeftBtnText(R.string.action_back);
		mActionBar.setTitle(R.string.scene_add_str);
		mActionBar.setRightBtnBackground(R.drawable.actionbar_sure_btn_bg);
		mActionBar.setActionBarOnClickListener(new ActionBarOnClick() {

			@Override
			public void rightBtnOnClick() {
				Toast.makeText(getApplication(), "rightBtnOnClick",
						Toast.LENGTH_SHORT).show();
			}

			@Override
			public void leftBtnOnClick() {
				finish();
			}
		});
	}

}
